package com.wz.jiangsu.config;

import com.wz.jiangsu.handler.MyWebSocketHandler.MyWebSocketHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

/**
 * @program: wz
 * @author: wangzhou
 * @create: 2024-10-27 11:10
 * @description:
 **/
@Configuration
@EnableWebSocket
public class WebSocketConfigB implements WebSocketConfigurer {

    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        registry.addHandler(new MyWebSocketHandler(), "/ws").setAllowedOrigins("*");
    }
}
